

<%@ page import="br.com.zanictech.ponto.RegistroPonto" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <g:set var="entityName" value="${message(code: 'registroPonto.label', default: 'RegistroPonto')}" />
        <title><g:message code="default.create.label" args="[entityName]" /></title>
    </head>
    <body>
        <div class="nav">
            <span class="menuButton"><a class="home" href="${createLink(uri: '/')}"><g:message code="default.home.label"/></a></span>
            <span class="menuButton"><g:link class="list" action="list"><g:message code="default.list.label" args="[entityName]" /></g:link></span>
        </div>
        <div class="body">
            <h1><g:message code="default.create.label" args="[entityName]" /></h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <g:hasErrors bean="${registroPontoInstance}">
            <div class="errors">
                <g:renderErrors bean="${registroPontoInstance}" as="list" />
            </div>
            </g:hasErrors>
            <g:form action="save" >
                <div class="dialog">
                    <table>
                        <tbody>
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="data"><g:message code="registroPonto.data.label" default="Data" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: registroPontoInstance, field: 'data', 'errors')}">
                                    <g:datePicker name="data" precision="day" value="${registroPontoInstance?.data}"  />
                                </td>
                            </tr>
                            
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="usuario"><g:message code="registroPonto.usuario.label" default="Usuario" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: registroPontoInstance, field: 'usuario', 'errors')}">
                                    <g:select name="usuario.id" from="${br.com.zanictech.ponto.Usuario.list()}" optionKey="id" value="${registroPontoInstance?.usuario?.id}"  />
                                </td>
                            </tr>
                            
                    	</tbody>
                    </table>
                    <table>
                    	<tbody>
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="entrada"><g:message code="registroPonto.entrada.label" default="Entrada:" /></label>
                                </td>
                                
                                <td valign="top" class="name">
                                    <label for="almoco"><g:message code="registroPonto.almoco.label" default="Almoco:" /></label>
                                </td>
                                
                                <td valign="top" class="name">
                                    <label for="tarde"><g:message code="registroPonto.tarde.label" default="Tarde:" /></label>
                                </td>
                                
                                <td valign="top" class="name">
                                    <label for="saida"><g:message code="registroPonto.saida.label" default="Saida:" /></label>
                                </td>
                            </tr>
                            
                            <tr>
                            	<td valign="top" class="value ${hasErrors(bean: registroPontoInstance, field: 'entrada', 'errors')}">
                                    <g:textField name="entrada" value="${registroPontoInstance?.entrada}" size="6" />
                                </td>
                                
                                <td valign="top" class="value ${hasErrors(bean: registroPontoInstance, field: 'almoco', 'errors')}">
                                    <g:textField name="almoco" value="${registroPontoInstance?.almoco}" size="6" />
                                </td>
                                
                                <td valign="top" class="value ${hasErrors(bean: registroPontoInstance, field: 'tarde', 'errors')}">
                                    <g:textField name="tarde" value="${registroPontoInstance?.tarde}" size="6" />
                                </td>
                                
                                <td valign="top" class="value ${hasErrors(bean: registroPontoInstance, field: 'saida', 'errors')}">
                                    <g:textField name="saida" value="${registroPontoInstance?.saida}" size="6" />
                                </td>
                            </tr>
						</tbody>
	                </table>
	                <table>
	                	<tbody>
	                		<tr>
		                		<td valign="top" class="name">
	                            	<label for="observacao"><g:message code="registroPonto.observacao.label" default="Observação:" /></label>
	                            </td>
	                        </tr>
	                        <tr>
		                        <td valign="top" class="value ${hasErrors(bean: registroPontoInstance, field: 'observacao', 'errors')}">
		                            <g:textArea name="observacao" value="${registroPontoInstance?.observacao}" rows="5" cols="8" />
		                         </td>
		                    </tr>
	                    </tbody>
                	</table>
                </div>
                <div class="buttons">
                    <span class="button"><g:submitButton name="create" class="save" value="${message(code: 'default.button.create.label', default: 'Create')}" /></span>
                </div>
            </g:form>
        </div>
    </body>
</html>
